﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Public;

namespace DAL
{
    public class PhieuDatChoDAL
    {
        clsKetNoi kn = new clsKetNoi();
        public int ThemPhieuDat(PhieuDatChoPublic p)
        {
            int Nparameter = 5;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@MaChuyenBay"; value[0] = p.MaChuyenBay;
            name[1] = "@MaHanhKhach"; value[1] = p.MaHanhKhach;
            name[2] = "@MaHangVe"; value[2] = p.MaHangVe;
            name[3] = "@GiaTien"; value[3] = p.GiaTien;
            name[4] = "@NgayDat"; value[4] = p.NgayDat;
            return kn.Update("PhieuDatCho_Insert", name, value, Nparameter);

            

        }
        public int XoaPhieuDat(PhieuDatChoPublic p)
        {
            int Nparameter = 1;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];
            name[0] = "@MaChuyenBay"; value[0] = p.MaChuyenBay;
            return kn.Update("PhieuDatCho_Huy", name, value, Nparameter);



        }
    }
}
